#ifndef TEST_H
#define TEST_H


#include"A.h"
#include"USvgIconEngine.h"
#include"MyIconEngine.h"
#include"IconFileTools.h"

#include<iostream>

#include <QMimeDatabase>
#include <QFile>

using namespace std;


QString getMimeType(const QString &filePath) {
    QMimeDatabase db;
    QFile file(filePath);
    if (file.open(QIODevice::ReadOnly)) {
        QByteArray data = file.read(1024); // 读取文件的前1024个字节用于MIME类型检测
        file.close();
        return db.mimeTypeForData(data).name();
    }
    return QString();
}




inline void test(){
    QString arr[] = {":/pngs/resources/pancake.png",":/svgs/resources/motor.svg",":/jpgs/resources/wallpaper2.jpg"};

    for(const QString& cur:arr)
    {
        IconFileType mimeType = probeIconMimeType(cur);
        QString mimeStr = getMimeType(cur);
        qDebug() << "类型 = " << mimeStr << "probe = " << QString::number((int)mimeType);
    }
}
#endif
